<?php
class Baigiang extends CI_Controller {
	public $data;
	public function __construct()
	{
		parent::__construct();
        $this->load->model(array('m_baigiang','m_nganh','m_khoahoc','m_table',));
        $this->load->helper('url');
        $this->load->helper('form');
        $this->data['baigiang']=true;
        $this->data = array (
            'nganh'       => $this->m_nganh->get_nganh(),
            'khoahoc'       => $this->m_baigiang->select_mon1(),
            'baigiang'       => $this->m_baigiang->select_baigiang(),
            'baigiang'    => true
        );
	}
    public function hienthibaigiang($id){
        $id = $this->uri->segment(3);
        $this->data['baigiang']= $this->m_baigiang->get_select();
        //$this->data['baigiang']= $this->m_baigiang->get_select_baigiang($id);
        $this->load->view('v_baigiang',$this->data);
    }
    public function mon(){ 
        $id = $this->uri->segment(3);
        //$this->data['baigiang']= $this->m_baigiang->select_mon1($id);
        $this->data['mon']= $this->m_baigiang->select_mon1($id);
        $this->load->view('v_mon',$this->data);
    }
    
    public function chitietbaigiang($id){
        $id = $this->uri->segment(3);
        printf($id);
        $this->data['chitietbaigiang']= $this->m_baigiang->get_select_chitiet_baigiang($id);
        $this->load->view('baigiang/v_chitietbaigiang',$this->data);
    }
 }